#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

bool isAnagram(char* s, char* t) {
    int len = strlen(s);
    if (len != strlen(t)) return false;
    int count[26] = { 0 };
    for (int i = 0; i < len; i++) {
        count[s[i] - 'a']++;
        count[t[i] - 'a']--;
    }
    for (int i = 0; i < 26; i++) {
        if (count[i] != 0) return false;
    }
    return true;
}

int main() {
    char *s = "ab";
    char *t = "ba";
    bool res = isAnagram(s, t);
    printf("res = %d\n", res);
    return 0;
}